﻿namespace Sgr.Organizations
{
    public class NullUserProvider : IUserProvider
    {
        // 共享的只读空集合，避免每次分配
        private static readonly IReadOnlyList<UserInfo> EmptyList = Array.Empty<UserInfo>();

        //public Task<IReadOnlyList<UserInfo>> GetAllAsync(CancellationToken ct = default)
        //{
        //    return Task.FromResult(EmptyList);
        //}

        //public Task<UserInfo?> GetByExternalIdAsync(string externalId, string source, CancellationToken ct = default)
        //{
        //    return Task.FromResult<UserInfo?>(null);
        //}

        public Task<IReadOnlyList<UserInfo>> GetByPermissionAsync(string orgId, string permission, int max, CancellationToken ct = default)
        {
            return Task.FromResult(EmptyList);
        }

        public Task<UserInfo?> GetByEmailAsync(string email, CancellationToken ct = default)
        {
            return Task.FromResult<UserInfo?>(null);
        }

        public Task<UserInfo?> GetByIdAsync(long orgId, long userId, CancellationToken ct = default)
        {
            return Task.FromResult<UserInfo?>(null);
        }

        public Task<UserInfo?> GetByMobileAsync(string mobile, CancellationToken ct = default)
        {
            return Task.FromResult<UserInfo?>(null);
        }

        public Task<IReadOnlyList<UserInfo>> GetDeptManagerUserAsync(string orgId, string deptId, int max, CancellationToken ct = default)
        {
            throw new NotImplementedException();
        }

        public Task<bool> CheckUserIsDeptManager(string orgId, string deptId, string userId, CancellationToken ct = default)
        {
            throw new NotImplementedException();
        }
    }
}